

//
//  ContentCell.m
//  BusinessMarket
//
//  Created by Michael Li on 2019/1/1.
//  Copyright © 2019年 Michael Li. All rights reserved.
//

#import "ContentCell.h"
#import "TYAttributedLabel.h"
#import "HomeModel.h"
#import "ServiceModel.h"
@interface ContentCell()
@property(nonatomic,strong) TYAttributedLabel *label;
@end
@implementation ContentCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
    }
    return self;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {

        self.label= [[TYAttributedLabel alloc]initWithFrame:CGRectMake(18, 0, kUIScreen.size.width-18*2,self.bounds.size.height)];
        self.label.backgroundColor = kWhite;
        self.label.font= [UIFont systemFontOfSize:13];
        self.label.textColor = kLabel102Color;
        self.label.characterSpacing = 2;
        self.label.linesSpacing = 5;
        [self.contentView addSubview:self.label];
//        [self.label sizeToFit];
    }
    return self;
}
- (void)setHomeModel:(HomeModel *)homeModel
{
    _homeModel = homeModel;
    self.label.text = nil;
    [self.label appendText:homeModel.represent];
    [self.label sizeToFit];
}
- (void)setServiceModel:(ServiceModel *)serviceModel
{
    _serviceModel = serviceModel;
    self.label.text = nil;
    [self.label appendText:serviceModel.represent];
    [self.label sizeToFit];
}
@end
